package com.gzhryc.shared_device.oem.code.agent.dao.db;

import com.gzhryc.common.data.ITree;
import com.gzhryc.jdbc.annotaion.Column;
import com.gzhryc.jdbc.annotaion.Id;
import com.gzhryc.jdbc.annotaion.Table;
import com.gzhryc.shared_device.oem.code.agent.dao.enums.AgentMenuEnum;

import java.io.Serializable;
import java.util.Date;

/**
 * 代理后台菜单
 * @version 2024-01-05
 */
@Table(name = "agent_menu")
public class AgentMenu implements ITree<Long>, Serializable {

    private static final long serialVersionUID = 1L;

	@Id
    protected Long id;

    @Column(notNull = true)
    protected String name;

    @Column
    protected String icon;

    @Column(notNull = true,defVal = "/",length = 255)
    protected String link;

    @Column(notNull = true,defVal = "1",note = "菜单类型：1-组，2-路径，3-功能")
    protected Integer type;

    @Column(length = 255,note = "权限标识，多个权限以逗号分隔")
    protected String permission;

    @Column(notNull = true, defVal = "10", note = "优先级")
    protected Integer priority;

    @Column(name = "parent_id")
    protected Long parentId;

    @Column(name = "update_date", autoUpdateTime = true)
    protected Date updateDate;

    @Column(name = "create_date")
    protected Date createDate;

    @Override
    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getIcon() {
        return icon;
    }

    public void setIcon(String icon) {
        this.icon = icon;
    }

    public String getLink() {
        return link;
    }

    public void setLink(String link) {
        this.link = link;
    }

    public Integer getType() {
        return type;
    }

    public void setType(Integer type) {
        this.type = type;
    }

    public String getPermission() {
        return permission;
    }

    public void setPermission(String permission) {
        this.permission = permission;
    }

    public Integer getPriority() {
        return priority;
    }

    public void setPriority(Integer priority) {
        this.priority = priority;
    }

    @Override
    public Long getParentId() {
        return parentId;
    }

    public void setParentId(Long parentId) {
        this.parentId = parentId;
    }

    public Date getUpdateDate() {
        return updateDate;
    }

    public void setUpdateDate(Date updateDate) {
        this.updateDate = updateDate;
    }

    public Date getCreateDate() {
        return createDate;
    }

    public void setCreateDate(Date createDate) {
        this.createDate = createDate;
    }

    public String getTypeName(){
        return AgentMenuEnum.Type.note(this.type);
    }
}
